package tech.aistar.corejava.day07.HomeWork;

/**
 * Created by 李雨昂 on 2019/7/23.
 */
/*public class Test extends Base{

    static{
        System.out.println("Test static");
    }

    public Test(){
        super();
        System.out.println("Test constructor");
    }

    public static void main(String[] args) {
        new Test();
    }
}*/
/*public class Test {

    static{
        System.out.println("Test static 1");
    }
    public static void main(String[] args) {

    }
    static{
        System.out.println("Test static 2");
    }

}*/

/*public class Test{
    static{
         x=5;
    }
    static int x,y;
    public static void main(String args[]){
        x--;

        myMethod( );
        System.out.println(x+y+ ++x);
    }
    public static void myMethod( ){
        y=x++ + ++x;
    }
}*/
/*
public class Test{
    private int a=10;
    int b=20;
    static int c=1;
    public static void main(String args[]){
        Test t = new Test();
//        t.a;
//        this.c;
//        Test.b;
//        Test.c;
    }

}
*/


/*
public class Test{
    //静态属性
    public static Test t1 = new Test();

    //普通代码块
    {
        System.out.println("blockA");
    }

    //静态代码块
    static{
        System.out.println("blockB");
    }

    public static void main(String[] args){
        Test t2 = new Test();
    }
}
*/

/*
public class Test{
    public static void main(String[] args){
        */
/*Pet p1 =  new Dog();
        System.out.println(p1 instanceof Dog);//true
        System.out.println(p1 instanceof Pet);//false
        p1.run();//dog is running

        Dog d1 = (Dog)p1;
        System.out.println(d1 instanceof Dog);//true
        System.out.println(d1 instanceof Pet);//false
        d1.run();//dog is running
*//*

        Pet p2 =  new Pet();
        Dog d2 = (Dog) p2;
        System.out.println(d2 instanceof Dog);//false
        System.out.println(d2 instanceof Pet);//true
    }

}*/
public class Test{
    public static void main(String args[]){
        B b = new B();
        A a = b;
        System.out.println(b.x);
        System.out.println(a.i);
    }
}
